<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="收款管理" name="collectMoney" lazy>
      <collectMoney :projectList="projectList" :userList="userList" :customerList="customerList" ref="collectMoney" :moneyType="1"></collectMoney>
    </el-tab-pane>
    <el-tab-pane label="付款管理" name="payMoney" lazy>
      <payMoney :projectList="projectList" :userList="userList" :customerList="customerList" ref="payMoney" :moneyType="0"></payMoney>
    </el-tab-pane>
  </el-tabs>
  </div>
</template>

<script>
import payMoney from './compoments/payMoney.vue'
import collectMoney from './compoments/collectMoney.vue'
export default {
  name: "CollectPayMoney",
  components: {
    payMoney, collectMoney
  },
  props: {
    userList: {
      type: Array,
      default: [],
    },
    projectList: {
      type: Array,
      default: [],
    },
    customerList: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {
      activeName: 'collectMoney'
    };
  },
  created() {
     this.$nextTick(() => {
        this.$refs[this.activeName].getList();
      });
  },
  methods: {
    handleClick(tab, event) {
      this.$nextTick(() => {
        this.$refs[this.activeName].getList();
      });
    },
  }
};
</script>

<style scoped>
</style>